#
# @lc app=leetcode.cn id=1446 lang=python
#
# [1446] 连续字符
#

# @lc code=start
class Solution(object):
    def maxPower(self, s):
        """
        :type s: str
        :rtype: int
        """
        l,r=0,0
        result=1
        while r<len(s):
            if s[r] == s[l]:
                r+=1
                result=max(result,r-l)
            else:
                l=r
                r+=1
        return result
# @lc code=end

